#include "dialog.h"
#include "ui_dialog.h"
#include "mywidget.h"
#include "ui_mywidget.h"
#include <QMessageBox>

Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui->setupUi(this);
}

Dialog::~Dialog()
{
    delete ui;
}


void Dialog::on_pushButton_clicked()
{
    if(ui->lineEdit->text()=="calmcar"&&ui->lineEdit_2->text()=="123456"){

        accept();

    }else{
        QMessageBox::critical(this, "警告","用户名或密码错误，请重新输入!",QMessageBox::Yes);
        ui->lineEdit->clear();
        ui->lineEdit_2->clear();
        ui->lineEdit->setFocus();

    }
}


void Dialog::on_pushButton_2_clicked()
{
    close();
}
